﻿@using MC.RideEvent.Mvc.Helpers
@using MC.RideEvent.Mvc.Models.ViewModel
@model IEnumerable<WayViewModel>
@{
    var member = Session["CurrentMember"] as MemberViewModel;
    var listCurrentWays = Model.Where(w => w.Event.DateBegin >= DateTime.Now && w.Event.DateEnd <= DateTime.Now);
    var listComingWays = Model.Where(w => w.Event.DateBegin > DateTime.Now);
    var listPerformedWays = Model.Where(w => w.Event.DateBegin < DateTime.Now);
}

<div class="list-waydriver">
    <h3>Trajets du jour (@listCurrentWays.Count())</h3>
    @foreach(var item in listCurrentWays)
    {
        <div class="item-way">
            <div class="field">
                <label>Evenement</label>
                <span>@item.Event.Title - @item.Event.DateBegin.ToStringFr() (@item.Event.City)</span>
            </div>
            <div class="field">
                <label>Vehicule</label>
                <span>@item.Vehicule.BrandAndModelToString</span>
            </div>
            <div class="field">
                <label>Rendez-vous</label>
                <span>@item.MeetingPlace - @item.MeetingHour</span>
            </div>
            <div class="field">
                <label>Participation</label>
                <span>@item.Contribution</span>
            </div>
            <div class="field">
                <label>Places disponibles</label>
                <span>@item.NumberPlaces</span>
            </div>
        </div>
    }
</div>

<div class="list-waydriver">
    <h3>Trajets avenirs (@listComingWays.Count())</h3>
    @foreach(var item in listComingWays)
    {
        <div class="item-way">
            <div class="field">
                <label>Evenement</label>
                <span>@item.Event.Title - @item.Event.DateBegin.ToStringFr() (@item.Event.City)</span>
            </div>
            <div class="field">
                <label>Vehicule</label>
                <span>@item.Vehicule.BrandAndModelToString</span>
            </div>
            <div class="field">
                <label>Rendez-vous</label>
                <span>@item.MeetingPlace - @item.MeetingHour</span>
            </div>
            <div class="field">
                <label>Participation</label>
                <span>@item.Contribution</span>
            </div>
            <div class="field">
                <label>Places disponibles</label>
                <span>@item.NumberPlaces</span>
            </div>
        </div>
    }
</div>

<div class="list-waydriver">
    <h3>Trajets effectués (@listPerformedWays.Count())</h3>
    @foreach(var item in listPerformedWays)
    {
        <div class="item-way">
            <div class="field">
                <label>Evenement</label>
                <span>@item.Event.Title - @item.Event.DateBegin.ToStringFr() (@item.Event.City)</span>
            </div>
            <div class="field">
                <label>Vehicule</label>
                <span>@item.Vehicule.BrandAndModelToString</span>
            </div>
            <div class="field">
                <label>Rendez-vous</label>
                <span>@item.MeetingPlace - @item.MeetingHour</span>
            </div>
            <div class="field">
                <label>Participation</label>
                <span>@item.Contribution</span>
            </div>
            <div class="field">
                <label>Places disponibles</label>
                <span>@item.NumberPlaces</span>
            </div>
        </div>
    }
</div>
